package ${table.genParam.packageName}.${table.genParam.moduleName}.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;

/**
 * ${field.desc} 枚举
 * 
 * @author gen by king
 * @email xxxx
 * @date ${.now?string["yyyy-MM-dd hh:mm:ss"]}
 */
public enum ${field.javaFieldType} implements IEnum<${field.fieldType.javaClass.simpleName}>  {
	<#assign enumSize = (field.enums?size)!0 >
	<#assign hasValue = false>
	<#list field.enums as enumItem>
	<#if enumItem.val?? && (enumItem.val?trim) != '' ><#assign hasValue = true></#if>
	/**
	 * ${(enumItem.desc)!}
	 */
	${(enumItem.name)!}<#if enumItem.val??>(${enumItem.val})</#if><#if enumItem_index lt (enumSize-1)>,<#else>;</#if>
	</#list>
	<#if hasValue>
	private ${field.javaFieldType}(${field.fieldType.javaClass.simpleName} _val) {
        this.val = _val;
    }
    
    private ${field.fieldType.javaClass.simpleName} val;
    </#if>

    @Override
    public ${field.fieldType.javaClass.simpleName} getValue() {
        return <#if hasValue>this.val<#else>this.name()</#if>;
    }
}
